package com.evil.application.pojo.dto.form.control;

import cn.hutool.core.bean.BeanUtil;
import com.evil.application.enums.form.control.ControlCodeEnum;
import lombok.Data;

import java.util.List;

/**
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
public class ControlCodeRespDTO {

    /**
     * 控件code
     */
    private String code;

    /**
     * 控件分类类型
     */
    private String type;

    /**
     * 控件名称
     */
    private String name;

    /**
     * 控件 规则校验符号
     */
    private List<ControlJudgeSignRespDTO> judgeSigns;

    public ControlCodeRespDTO(ControlCodeEnum controlCodeEnum) {
        BeanUtil.copyProperties(controlCodeEnum, this, "judgeSigns");

        if (null != controlCodeEnum.getJudgeSigns()) {
            this.judgeSigns = controlCodeEnum.getJudgeSigns().getAll();
        }
    }
}
